package org.springcloud.wisdom.spring_02_classroom.student.attendence.change;

import org.springcloud.wisdom.spring_02_classroom.bean.BaseController;
import org.springcloud.wisdom.spring_02_classroom.bean.ResponseData;
import org.springcloud.wisdom.spring_02_classroom.student.attendence.entity.AttendenceEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/attendence")
public class AttendenceController2 extends BaseController {

    @Autowired
    private AttendenceService2 attendenceService2;

    //修改签到次数
    @PostMapping("/updateSignCount")
    public ResponseData<Object> updateSignCount(@RequestBody AttendenceEntity attendenceEntity) {
        boolean success = attendenceService2.updateSignCount(attendenceEntity);
        if (success) {
            return new ResponseData<>(200, "修改成功", null);
        } else {
            return new ResponseData<>(500, "修改失败", null);
        }
    }
}